<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="path" value="${pageContext.request.contextPath }"></c:set>
<c:set var="socketPort" value="<%=com.holystone.orca.common.WebSocketConfig.socketPort%>"></c:set>
<c:set var="socketIp" value="<%=com.holystone.orca.common.WebSocketConfig.socketIp%>"></c:set>

<!DOCTYPE html>
<html>
<head lang="cn">
<meta charset="UTF-8">
<title>北京合力思腾科技股份有限公司</title>
<script src="${path }/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="${path }/js/user_js.js"></script>
<script src="${path }/js/common.js"></script>
<script src="${path }/common/plugins/handlebars.js" type="text/javascript"></script>
<script src="${path }/common/plugins/bootstrap/js/bootstrap.js"></script>
<script src="index.js"></script>
<link href="${path }/css/style.css" rel="stylesheet" type="text/css">
<link href="${path }/css/index.css" rel="stylesheet" type="text/css">
<link href="${path }/common/plugins/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
<script src="${path }/common/plugins/layer/layer.js"></script>
<script type="text/javascript">
    var socketIp = "${serverIp}";
    var socketPort = "${serverPort}";
    var basePath = "${path}";
</script>
</head>
<body>
<input type="hidden" name="path" value="${path}">
<input type="hidden" id="staffId" value="${staffId }">
<%--<input type="hidden" id="socketIp" value="${socketIp}">--%>
<%--<input type="hidden" id="socketPort" value="${socketPort}">--%>
	<div id="head">
		<div class="head">
			<div class="logo">
				<img src="${path }/images/logo-1.png" style="height:44px;float:left;">
            	<h2 id="sys_name" style="float:left;">${menuNavList.get(0).remark}</h2>
			</div>
			<ul class="project_handover">
				<c:forEach items="${menuNavList}" var="menuNavVO" begin="0" end="${fn:length(menuNavList)}" varStatus="status">
					<li>
						<a href="javascript:void(0)" remark="${menuNavVO.priName}" mark="${menuNavVO.priName}_nav" path="${path }/" url="${menuNavVO.url}" <c:if test="${status.index==0}">class="Selected"</c:if> >
							<i class="${menuNavVO.priName} top_current"></i>
						</a>
						<span>${menuNavVO.priName}</span>
					</li>
				</c:forEach>
				<li><a href="logout.do" mark="logout_nav"><i class="cancellation top_current"></i></a><span>注销 </span></li>
				<%--<li><a href="#" mark="user_nav"><i class="user top_current"></i></a><span>${personName}</span></li>--%>
				<li><a href="javascript:void(0)" class="top_user" mark="5"><i class="admin top_current"></i></a><span>${personName}</span></li>
			<!-- 	<li><a href="javascript:void(0)"><i class="search top_current" style="margin-top:0"></i></a><span>搜索</span></li> -->
				<%-- <li><i class="user top_current" style="margin: 10px 0;"></i><span>${personName}</span></li> --%>
			</ul>
		</div>

		<div id="nav">
			<c:forEach items="${menuNavList}" var="nav" varStatus="nav_status">
				<ul class="${nav.priName}_nav" <c:if test="${nav_status.index!=0}">style="display: none;"</c:if>>
					<c:forEach items="${nav.menuList}" var="menu" begin="0" end="${fn:length(nav.menuList)}" varStatus="menu_status">
						<li class="dropdown drophome <c:if test="${menu_status.index==0}">current</c:if>" id="${menu.priId}">
							<a class="dropdown-toggle" data-toggle="dropdown" href="javascript:void(0)" path="${path }/" url="${menu.url}">
								<i class="authority top_current"></i>
								<span>${menu.priName}</span>
								<span class="downward top_current"></span>
							</a>
						</li>
					</c:forEach>
				</ul>
			</c:forEach>
		</div>
	</div>
	<div style="background: #f1f1f1;overflow: hidden">
		<div class="menu_l" style="float:left;">
			<c:forEach items="${menuNavList}" var="nav" varStatus="nav_status">
				<div class="${nav.priName}_menu" <c:if test="${nav_status.index!=0}">style="display: none;"</c:if>>
					<c:forEach items="${nav.menuList}" var="menu" begin="0" end="${fn:length(nav.menuList)}" varStatus="menu_status">
						<c:choose>
							<c:when test="${not empty menu.menuList}">
								<ul class="includeul" <c:if test="${menu_status.index!=0}">style="display: none;"</c:if>>
									<c:forEach items="${menu.menuList}" var="submenu" varStatus="submenu_status">
						                <li <c:if test="${submenu_status.index==0}">class="current"</c:if> name="" path="${path }/" url="${submenu.url}">${submenu.priName}</li>
						            </c:forEach>
								</ul>
							</c:when>
							<c:otherwise>
								<ul class="no_includeul" <c:if test="${menu_status.index!=0}">style="display: none;"</c:if>>
									<li class="current" name="" path="${path }/" url="${submenu.url}"></li>
								</ul>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</div>
			</c:forEach>
		</div>
        <div class="menu_r" style="float:left">
            <%--<iframe id="platform_content" title="platform_content" height="98%" scrolling="auto" src="${path }/${menuNavList.get(0).url}" style="padding:0;"></iframe>--%>
            <iframe id="platform_content" title="platform_content" height="98%"
                    width="100%" scrolling="auto" src="${path }/${menuNavList.get(0).url}"
                    style=" padding: 0"></iframe>
        </div>
	</div>
    <div class="alert_box" style="display: none">

    </div>
    <div class="bottomlist" style="display: none">
        <div class="list_top">
            <div style="float:right;padding: 0 10px;">
                <ul class="alarm_num">
                    <li title="critical">0</li>
                    <li title="error">0</li>
                    <li title="warning">0</li>
                </ul>
                <ul class="toollist">
                    <li class="open1"><i class="open_message toollist_n" title="关闭消息提醒"></i></li>
                    <li class="open2"><i class="open_sound toollist_n" title="关闭声音提醒"></i></li>
                    <li class="open"><i class="shutup toollist_n" title="打开"></i></li>
                </ul>
            </div>
        </div>
        <div class="list_bottom">
            <div class="content">
                <ul class="nav nav-tabs" id="tab">
                    <li class="active"><a href="#loglist" data-toggle="tab">日志告警</a></li>
                    <li><a href="#alarmlist" data-toggle="tab">最新告警</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="loglist">
                        <div class="control-title">
                            <i class="list content_current"></i><span>日志告警列表</span>
                            <div class="spanbtn">
                                <button class="press_btn1"><i class="more top_current"></i>更多</button>
                            </div>
                        </div>
                        <div class="content_table">
                            <table class="table table-striped table-bordered table-hover table-ellipsis details">
                                <thead>
                                <tr>
                                    <th style="width:120px;">主机IP</th>
                                    <th style="width:120px;">级别</th>
                                    <th style="width:120px;">类别</th>
                                    <th style="width:200px;">日期</th>
                                    <th>消息</th>
                                </tr>
                                </thead>
                                <tbody id="sysLogAlarm">
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="tab-pane" id="alarmlist">
                        <div class="control-title">
                            <i class="list content_current"></i><span>最新告警列表</span>
                            <div class="spanbtn">
                                <button class="press_btn1"><i class="more top_current"></i>更多</button>
                            </div>
                        </div>
                        <div class="content_table">
                            <table class="table table-striped table-bordered table-hover table-ellipsis details">
                                <thead>
                                <tr>
                                    <th>主机IP</th>
                                    <th>主机名称</th>
                                    <th>告警指示名称</th>
                                    <th>告警级别</th>
                                    <th>告警类型</th>
                                    <th>告警时间</th>
                                    <th>告警次数</th>
                                    <th>告警状态</th>
                                    <%--<th>操作</th>--%>
                                </tr>
                                </thead>
                                <tbody>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="div1" style="display:none;"></div>
    </div>
</body>
</html>
<script id="log-template" type="text/x-handlebars-template">
    {{#each data}}
    <tr>
        <td>{{hostIp}}</td>
        <td>{{alarmLevel}}</td>
        <td>{{syslogTypeName}}</td>
        <td>{{alarmTime}}</td>
        <td>{{alarmMessage}}</td>
    </tr>
    {{/each}}
</script>
<script id="alarm-template" type="text/x-handlebars-template">
    {{#each data}}
    <tr>
        <td>{{insIp}}</td>
        <td>{{insName}}</td>
        <td>{{indicatorName}}</td>
        <td>{{dealAlarmLevel alarmLevel}}</td>
        <td>{{dealAlarmType alarmType}}</td>
        <td>{{prettifyDate lastAlarmTime}}</td>
        <td>{{alarmNumber}}</td>
        <td>{{dealAlarmState alarmState}}</td>
    </tr>
    {{/each}}
</script>